package com.lb.shopguide.adapter.viewpager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lb.shopguide.constants.AppConstant;
import com.lb.shopguide.entity.goods.GoodsTypeBean;
import com.lb.shopguide.ui.fragment.boss.FragmentPointPercent;
import com.lb.shopguide.ui.fragment.boss.market.FragmentMarketMyActivity;
import com.lb.shopguide.ui.fragment.boss.market.FragmentMarketTemplate;
import com.lb.shopguide.ui.fragment.guide.FragmentEnterPhone;
import com.lb.shopguide.ui.fragment.guide.goods.FragmentGoodsList;

import java.util.List;

/**
 * Created by kang on 2017/6/3.
 */

public class AdapterMarketing extends FragmentPagerAdapter {

    private String[] titles;


    public AdapterMarketing(FragmentManager fm, String[] titles) {
        super(fm);
        this.titles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case AppConstant.FIRST:
                return FragmentMarketTemplate.newInstance();
            case AppConstant.SECOND:
                return FragmentMarketMyActivity.newInstance();
        }
        return null;
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
